package com.huiyuan.mapper;

import com.huiyuan.common.Bike;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author huiyuan080
 * @data 2023/5/2
 * @apiNote
 */
@Mapper
public interface BikeMapper {
    int deleteByPrimaryKey(Integer bikeId);

    int insert(Bike record);

    int insertSelective(Bike record);

    Bike selectByPrimaryKey(Integer bikeId);

    int updateByPrimaryKeySelective(Bike record);

    int updateByPrimaryKey(Bike record);

    /**
     * 分页查询使用车辆
     *
     * @return
     */
    List<Bike> getPage();

    /**
     * 修改车辆的使用情况
     * @param bicycleId
     * @return
     */
    int addUse(@Param("bicycleId") Integer bicycleId);

    /**
     * 车辆的状态
     *
     * @param bicycleId
     * @return
     */
    Bike isNull(@Param("bicycleId") Integer bicycleId);
}